package com.tengju.bff.interfaces.covercharge.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tengju.bff.interfaces.covercharge.entity.po.ServiceLetaxWithdrawLog;
import com.tengju.bff.interfaces.covercharge.entity.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 乐税个体户体现明细表 Mapper 接口
 * </p>
 *
 * @author zhaoyi
 * @since 2020-02-24
 */
@Component
public interface ServiceLetaxWithdrawLogMapper extends BaseMapper<ServiceLetaxWithdrawLog> {

    List<WithdrawRecordVo> getWithdrawList(@Param("idCode") Integer idCode, @Param("platformCode") String platformCode, @Param("type") String type, @Param("dateTime") String dateTime);

    BigDecimal getIssuedAmount(@Param("idCode") Integer idCode, @Param("platformCode") String platformCode, @Param("type") String type, @Param("dateTime") String dateTime);

    BigDecimal getBeIssuedAmount(@Param("idCode") Integer idCode, @Param("platformCode") String platformCode, @Param("type") String type, @Param("dateTime") String dateTime);

    List<PersonalGiveVo> queryPersonalGiveList(Page page, @Param("personalGiveQuery") PersonalGiveQuery personalGiveQuery);

    List<PersonalGiveVo> queryPersonalGiveListAllPaid(Page page, @Param("personalGiveQuery") PersonalGiveQuery personalGiveQuery);

    List<WithdrawRecordVo> withdrawListByTime(@Param("idCode") Integer idCode, @Param("platformCode") String platformCode, @Param("type") String type, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<WithdrawLogRecordVo> queryPageByIdCode(Page page, @Param("idCode") String idCode, @Param("status") String status);

    IPage<ServiceLetaxWithdrawLogVo> queryPageByCycleAddId(Page page, @Param("cycleAddId") Integer cycleAddId);

    BigDecimal sumMoney(@Param("cycleAddId") Integer cycleAddId, @Param("status") Integer status);

    WithdrawLogRecordVo queryLogByCycleAddId(@Param("cycleAddId") Integer cycleAddId);

    /**
     * 修改提现记录中的乐税状态
     *
     * @param letaxStatus
     * @param nowDate
     * @param cycleAddId
     */
    void updateLetaxStatus(@Param("letaxStatus") Integer letaxStatus, @Param("nowDate") Date nowDate, @Param("cycleAddId") Integer cycleAddId);

    List<PersonalGiveVo> queryPersonalGiveListWithIds(Page<PersonalGiveVo> page, @Param("personalGiveQuery") PersonalGiveQuery personalGiveQuery);

    List<PersonalGiveVo> queryPersonalGiveMoneyList(@Param("personalGiveQuery") PersonalGiveQuery personalGiveQuery);
}
